<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="/templates/templateLogin.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:define name="head">
        <title>Login</title>
    </ui:define>
    <ui:define name="body">
        <br />
        <h:form id="formLogin">
            <div align="center">
                <h:messages id="msgs" showDetail="true" />
                <p:messages autoUpdate="true" showDetail="true" />
                <p:growl id="confirm" autoUpdate="true" showDetail="true"/>  
            
                <p:panelGrid columns="2" >
                    <f:facet name="header">
                        #{msg['login.title']}
                    </f:facet>
                    <p:outputLabel for="txtUser" value="#{msg['login.username']}" />
                    <p:inputText id='txtUser' value="#{loginController.usuario}" required="true" />
                    <p:outputLabel for="txtPassword" value="#{msg['login.password']}" />
                    <p:password id="txtPassword" value="#{loginController.password}" required="true" />
                    <f:facet name="footer">
                        <div align="center">
                            <p:commandButton value="#{msg['login.button.login']}" 
                                             action="#{loginController.login()}"
                                             update="msgs"/>
                        </div>
                    </f:facet>
                </p:panelGrid>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
